angular.module('app.confirm')
    .controller('confirmCommentCtrl', ['$scope', '$modalInstance', 'product','invService','toaster',
        function ($scope, $modalInstance,product,invService,toaster) {

        $scope.title="提示";
        $scope.comment={
            "id":product.id
        };
        $scope.cancel = function () {
            $modalInstance.dismiss('cancel');
        };

        $scope.ok = function () {
            invService.delete($scope.comment).then(function(res){
                toaster.pop("success", "成功·", "删除成功");
                $modalInstance.close();
            },function(res){
                toaster.pop("error", "错误", res.errMsg || "查询失败")
            });
        };

    }]);